#ifndef PROXY_H
#define PROXY_H

#include "subject.h"
#include"realsubject.h"
#include <iostream>
#include <memory>
#include <mutex>
#include <unordered_map>
class Proxy : public Subject
{
public:
    Proxy();
    ~Proxy();
    std::string request(const std::string& data) override;

private:
    std::shared_ptr<RealSubject> mrealSubject;
    std::unordered_map<std::string, std::string> mcache;
    std::mutex mtx;
};

#endif // PROXY_H
